package edu.hawaii.myisern.users;

import static org.junit.Assert.assertTrue;

import java.security.NoSuchAlgorithmException;

import org.junit.Test;

/**
 * Test of the User Manager object.
 * @author John Hauge
 *
 */
public class TestUserManager {
  /**
   * Testing of user authentication.
   * @throws NoSuchAlgorithmException if error occurs.
   */
  @Test
  public void testUserAuthentication() throws NoSuchAlgorithmException {
    UserManager um = new UserManager();
    User u1 = new User("Bob", "knob");
    User u2 = new User("Franky", "Fish");
    //System.out.println(u1.equals(u2));
    um.addUser(u1);
    um.addUser(u2);
    assertTrue("User: Bob, Pass: knob", um.authenticate("Bob", "knob"));
    assertTrue("User: Franky, Pass: Fish", um.authenticate("Franky", "Fish"));
  }
}
